<?php




require_once 'Zend/Search/Lucene/Search/Query.php';



class Zend_Search_Lucene_Search_Query_Empty extends Zend_Search_Lucene_Search_Query
{
    
    public function rewrite(Zend_Search_Lucene_Interface $index)
    {
        return $this;
    }

    
    public function optimize(Zend_Search_Lucene_Interface $index)
    {
        // "Empty" query is a primitive query and don't need to be optimized
        return $this;
    }

    
    public function createWeight(Zend_Search_Lucene_Interface $reader)
    {
        require_once 'Zend/Search/Lucene/Search/Weight/Empty.php';
        return new Zend_Search_Lucene_Search_Weight_Empty();
    }

    
    public function execute(Zend_Search_Lucene_Interface $reader, $docsFilter = null)
    {
        // Do nothing
    }

    
    public function matchedDocs()
    {
        return array();
    }

    
    public function score($docId, Zend_Search_Lucene_Interface $reader)
    {
        return 0;
    }

    
    public function getQueryTerms()
    {
        return array();
    }

    
    protected function _highlightMatches(Zend_Search_Lucene_Search_Highlighter_Interface $highlighter)
    {
        // Do nothing
    }

    
    public function __toString()
    {
        return '<EmptyQuery>';
    }
}

